<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/com/com.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
<title>update</title>
<!-- 县 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".CountId").each(function(){//循环获取所有单位编号 
			var sysCountId = $(this).attr("value");
			var CountId = $("#sysVillageSysCountId").attr("value");
			if(sysCountId == CountId){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 镇 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".TownId").each(function(){//循环获取所有单位编号 
			var sysTownId = $(this).attr("value");
			var TownId = $("#sysVillageSysTownId").attr("value");
			if(sysTownId == TownId){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
</head>
  
  <body>
   <div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-key"></span></strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="<%=basePath%>/sys/SysVillage_update.action">
    <input type="hidden" name="id" value="${sysVillage.id}" >
   
    
    <div class="form-group">
          <div class="label">
            <label>县：</label>
          </div>
          <div class="field">
          <select name="countId"  class="input w50">
             <option value="">县分类</option>
				<s:iterator value="sysCountAllList">
				<option class="CountId" value="${countId}" id="${countId}">${countName}</option>
				</s:iterator>
            </select>
            <div class="tips"></div>
          </div>
    </div>
    
    <div class="form-group">
          <div class="label">
            <label>镇：</label>
          </div>
          <div class="field">
          <select name="townId"  class="input w50">
             <option value="">镇分类</option>
				<s:iterator value="sysTownAllList">
				<option  class="TownId" value="${sysTownId}" id="${sysTownId}">${sysTownName}</option>
				</s:iterator>
            </select>
            <div class="tips"></div>
          </div>
    </div>
    <div class="form-group">
        <div class="label">
          <label for="sitename">村编码：</label>
        </div>
        <div class="field">
           <input type="test" class="input w50" id="villageId" name="villageId" value="${sysVillage.villageId}" size="50" placeholder="请输入村名" data-validate="required:请输入村名" />   
        </div>
      </div> 
      
      <div class="form-group">
        <div class="label">
          <label for="sitename">村名：</label>
        </div>
        <div class="field">
           <input type="test" class="input w50" id="villageName" name="villageName" value="${sysVillage.villageName}" size="50" placeholder="请输入村名" data-validate="required:请输入村名" />   
        </div>
      </div>  
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>   
        </div>
      </div>      
    </form>
  </div>
</div>
 <input name="sysVillage.countId" type="hidden" id="sysVillageSysCountId" value="${sysVillage.countId}"/>  <!-- 用于下拉选择的读取-县 -->
 <input name="sysVillage.townId" type="hidden" id="sysVillageSysTownId" value="${sysVillage.townId}"/>  <!-- 用于下拉选择的读取-镇 -->
  </body>
</html>
